<template>
    <div>
        <jsscom-heard />
        <div class="cons">
            <div class="pu-con">
                <div class="gy-cons">
                    <gy-com-left
                        @onLeftTab="onLeftTab"
                        :leftTitle="leftTitle"
                        :navList="navList"
                        :curIndex="curIndex"
                    />
                    <div class="gy-r">
                        <div class="gy-r-1">
                            <p>{{ leftTitle1 }}</p>
                        </div>
                        <xiehui-right :param="param" />
                    </div>
                </div>
            </div>
        </div>
        <com-foot></com-foot>
    </div>
</template>

<script>
import _ from "underscore";
import jsscomHeard from "@/components/jsscom-heard";
import comFoot from "@/components/com-foot";
import gyComLeft from "@/components/gy-com-left";
import xiehuiRight from "./xiehui-right";

export default {
    components: {
        jsscomHeard,
        comFoot,
        gyComLeft,
        xiehuiRight,
    },
    data() {
        return {
            leftTitle: "行业资讯",
            leftTitle1: "",
            curIndex: 0,
            navList: [],
            param: {},
        };
    },
    created() {
        this.getHyzxMenu();
    },
    mounted() {},
    methods: {
        onLeftTab(index, e) {
            this.curIndex = index;
            console.log(index);
            this.param = this.navList[index];
            this.leftTitle1 = this.param.title;
        },
        async getHyzxMenu() {
            const res = await this.$store.dispatch("news/getHyzxMenu");
            this.navList = res;
            this.param = this.navList[this.curIndex];
            this.leftTitle1 = this.param.title;
            console.log(res);
        },
    },
};
</script>

<style scoped>
@import "./hyzixun.css";
</style>
